package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ZhuanjiaBiandongHistoryMapper;
import com.ruoyi.system.domain.ZhuanjiaBiandongHistory;
import com.ruoyi.system.service.IZhuanjiaBiandongHistoryService;
import com.ruoyi.common.core.text.Convert;

/**
 * 专家变动历史Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-03-22
 */
@Service
public class ZhuanjiaBiandongHistoryServiceImpl implements IZhuanjiaBiandongHistoryService 
{
    @Autowired
    private ZhuanjiaBiandongHistoryMapper zhuanjiaBiandongHistoryMapper;

    /**
     * 查询专家变动历史
     * 
     * @param id 专家变动历史主键
     * @return 专家变动历史
     */
    @Override
    public ZhuanjiaBiandongHistory selectZhuanjiaBiandongHistoryById(String id)
    {
        return zhuanjiaBiandongHistoryMapper.selectZhuanjiaBiandongHistoryById(id);
    }

    /**
     * 查询专家变动历史列表
     * 
     * @param zhuanjiaBiandongHistory 专家变动历史
     * @return 专家变动历史
     */
    @Override
    public List<ZhuanjiaBiandongHistory> selectZhuanjiaBiandongHistoryList(ZhuanjiaBiandongHistory zhuanjiaBiandongHistory)
    {
        return zhuanjiaBiandongHistoryMapper.selectZhuanjiaBiandongHistoryList(zhuanjiaBiandongHistory);
    }

    /**
     * 新增专家变动历史
     * 
     * @param zhuanjiaBiandongHistory 专家变动历史
     * @return 结果
     */
    @Override
    public int insertZhuanjiaBiandongHistory(ZhuanjiaBiandongHistory zhuanjiaBiandongHistory)
    {
        return zhuanjiaBiandongHistoryMapper.insertZhuanjiaBiandongHistory(zhuanjiaBiandongHistory);
    }

    /**
     * 修改专家变动历史
     * 
     * @param zhuanjiaBiandongHistory 专家变动历史
     * @return 结果
     */
    @Override
    public int updateZhuanjiaBiandongHistory(ZhuanjiaBiandongHistory zhuanjiaBiandongHistory)
    {
        return zhuanjiaBiandongHistoryMapper.updateZhuanjiaBiandongHistory(zhuanjiaBiandongHistory);
    }

    /**
     * 批量删除专家变动历史
     * 
     * @param ids 需要删除的专家变动历史主键
     * @return 结果
     */
    @Override
    public int deleteZhuanjiaBiandongHistoryByIds(String ids)
    {
        return zhuanjiaBiandongHistoryMapper.deleteZhuanjiaBiandongHistoryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除专家变动历史信息
     * 
     * @param id 专家变动历史主键
     * @return 结果
     */
    @Override
    public int deleteZhuanjiaBiandongHistoryById(String id)
    {
        return zhuanjiaBiandongHistoryMapper.deleteZhuanjiaBiandongHistoryById(id);
    }

    @Override
    public long getMaxOrdernum(String ppZhuanjiaId){
        Object mmMaxOrdernum=zhuanjiaBiandongHistoryMapper.getMaxOrdernum(ppZhuanjiaId);
        return mmMaxOrdernum==null?0:Long.parseLong(mmMaxOrdernum.toString());
    }
}
